package com.aivin.firplugin.tool;

import java.util.Locale;
import java.util.ResourceBundle;

/**
 * 用来国际化 配置的文件
 */
public class ResourceTool {
    private ResourceBundle resourceBundle ;
    private ResourceTool(){
        resourceBundle = ResourceBundle.getBundle( "allmessages", Locale.CHINA);
    }

    public  String getString(String key){
        return  resourceBundle.getString(key) ;
    }


    public static ResourceTool instance() {
        return SingletonFactory.instance;
    }

    private static class SingletonFactory  {
        // 由 JVM 来保证线程安全
        private static ResourceTool instance = new ResourceTool();
    }
}
